package com.albert.funny;

import android.location.Location;
import android.location.LocationManager;

public class LocationValidationUtil
{
    protected static final long VALIDATING_TIME = 2*60*1000;
    public static boolean isValidLocation(Location location)
    {
        long currentTimeStamp = System.currentTimeMillis();
        if(location != null && currentTimeStamp - location.getTime() <= VALIDATING_TIME)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
    public static boolean isFineLocation(Location location)
    {
        if(location != null && location.getProvider().equalsIgnoreCase(LocationManager.GPS_PROVIDER))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}
